import { Middleware } from 'redux'

// 例如可以利用中间件来进行日志记录、创建崩溃报告、调用异步接口或者路由等等

export const actionLog: Middleware = (store) => {
	// console.log(store.getState())
	return (next) => {
		// console.log(next)
		return (action) => {
			// console.log("state 当前", store.getState())
			// console.log("fire action ", action)
			next(action)
			// console.log("state 更新", store.getState())
		}
	}
}

// let next = store.dispatch
// store.dispatch = function dispatchAndLog(action){
//   next(action)
// }
